package com.ruoyi.house_sale.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.house_sale.mapper.DiscountMapper;
import com.ruoyi.house_sale.domain.Discount;
import com.ruoyi.house_sale.service.IDiscountService;

/**
 * 优惠方案Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-15
 */
@Service
public class DiscountServiceImpl implements IDiscountService 
{
    @Autowired
    private DiscountMapper discountMapper;

    /**
     * 查询优惠方案
     * 
     * @param discountid 优惠方案主键
     * @return 优惠方案
     */
    @Override
    public Discount selectDiscountByDiscountid(Long discountid)
    {
        return discountMapper.selectDiscountByDiscountid(discountid);
    }

    /**
     * 查询优惠方案列表
     * 
     * @param discount 优惠方案
     * @return 优惠方案
     */
    @Override
    public List<Discount> selectDiscountList(Discount discount)
    {
        return discountMapper.selectDiscountList(discount);
    }

    /**
     * 新增优惠方案
     * 
     * @param discount 优惠方案
     * @return 结果
     */
    @Override
    public int insertDiscount(Discount discount)
    {
        return discountMapper.insertDiscount(discount);
    }

    /**
     * 修改优惠方案
     * 
     * @param discount 优惠方案
     * @return 结果
     */
    @Override
    public int updateDiscount(Discount discount)
    {
        return discountMapper.updateDiscount(discount);
    }

    /**
     * 批量删除优惠方案
     * 
     * @param discountids 需要删除的优惠方案主键
     * @return 结果
     */
    @Override
    public int deleteDiscountByDiscountids(Long[] discountids)
    {
        return discountMapper.deleteDiscountByDiscountids(discountids);
    }

    /**
     * 删除优惠方案信息
     * 
     * @param discountid 优惠方案主键
     * @return 结果
     */
    @Override
    public int deleteDiscountByDiscountid(Long discountid)
    {
        return discountMapper.deleteDiscountByDiscountid(discountid);
    }
}
